﻿using UnityEngine;

/*
 * 背景音乐播放器，提供起始音乐和循环音乐播放
 */
public class AudioBase : MonoBehaviour
{
    float m_fVolume = 1;
    float m_fSpeed = 1;
    public float Volume
    {
        get
        {
            return m_fVolume;
        }
        set
        {
            m_fVolume = value;
        }
    }
    public float Speed
    {
        get
        {
            return m_fSpeed;
        }
        set
        {
            m_fSpeed = value;
        }
    }

    public virtual void SetSpeed(float speed)
    {
        m_fSpeed = speed;
    }
    public virtual void SetVolume(float volume)
    {
        Volume = volume;
        if (volume <= 0)
            Stop();

    }

    public virtual void Stop()
    {
    }
}
